{% extends '0.框架.html' %}
{% block title %}
首页
{% endblock %}
{% block mate %}
<main class="container bg-white p-3 rounded">
    <h1>博客列表</h1>
    <div class="row row-cols-2 row-gap-3">
        {% for blog in blogs %}
        <div class="col">
            <div class="card ">
  <div class="card-header">
    <h3><a href="{% url 'blog:detail' blog_id=blog.id %}">{{ blog.title }}</a></h3>
  </div>
  <div class="card-body" style="height: 120px">
    <p class="card-text">{{ blog.content|striptags|truncatechars:200 }}</p>
  </div>
  <div class="card-footer text-muted d-flex justify-content-between">
    <div >
        <img src="{% static 'img/moban.png' %}" class="rounded-circle" width="30px" height="30px">
        {{ blog.author.username }}
    </div>
      <div>
          <p>发布时间:{{ blog.pub_time|date:'Y年m月d日 h时i分' }}</p>
      </div>
  </div>
</div>
        </div>
{% endfor %}

    </div>
</main>
{% endblock %}